package PlanUI;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.rmi.RemoteException;

import javax.swing.JOptionPane;

public class AdminViewPlan extends PlanSelect
{
	PlanDetail pd = new PlanDetail();
	public AdminViewPlan()
	{
		super();
		setOpaque(false);
		setSize(1280,725*4/5);
		pd.setLocation(512, 0);
		pd.setButtonVisible(false);
		add(pd);
		
		search.addActionListener(new searchListener());
	}
	
	public class searchListener implements ActionListener
	{

		public void actionPerformed(ActionEvent arg0)
		{
			try
			{
				receive = pls.getPlan((String)department.getSelectedItem());
				
			} catch (RemoteException e)
			{
				e.printStackTrace();
			}
			if(receive==null||receive.list.size()==0)
			{
				JOptionPane.showMessageDialog(null, "Not found");
			}else
			{
				pd.showPlan(receive);
			}
		}
	}
}
